package Task2;

import java.util.Scanner;

public class Main2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            String str = scanner.nextLine();
            char[] elem = str.toCharArray();
            reverse(elem, 0, elem.length - 1);
            int start = 0;
            while (start < elem.length){
                int end = start;
                while (end < elem.length && elem[end] != ' '){
                    end++;
                }
                reverse(elem,start,end - 1);
                start = end + 1;
            }
            String str2 = new String(str);
            System.out.println(str2);
        }
    }

    public static void reverse(char[] arr, int start, int end) {
        while (start < end) {
            char ch = arr[start];
            arr[start] = arr[end];
            arr[end] = ch;
            start++;
            end--;
        }
    }
}
